<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>

<html>
  <body>
<%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
		response.sendRedirect(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/index.html");
    } else {
    	response.sendRedirect(userService.createLoginURL(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/index.html"));
    }
%>
</body>
</html>
